Boolean Expressions

Boolean expressions are relational comparisons between numeric expressions resulting in a value of either True or False. Boolean expressions are used most often in IF...THEN and other control statements. The following relational operators are used in Boolean expressions:

Operator

Meaning

=

Equal to

>

Greater than

<

Less than

>=

Greater than or equal to

<=

Less than or equal to

<>

Not equal to

Relational operator examples

A = B

A > B

A < B

A >= B

A <= B

A <> B

Spacing between the terms and operators within a numeric expression is optional. However, for operators with two characters (for example, >=, <=, <>), no spaces are allowed between characters in the operator.

Additionally, the following operators compare two Boolean expressions.

Operator

Meaning

AND

TRUE if both expressions are TRUE

OR

TRUE if one expression is TRUE

NOT

Makes TRUE expressions FALSE and FALSE expressions TRUE

For information on operator precedence and nesting rules, see Operator Precedence.